public class primeNumber {
    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        boolean isPrime = true;
        for (int i = 2; i <= 10000; i++) {
            for (int j = 2; j < Math.sqrt(i); j++) {
                // for (int j = 2; j < i; j++) {
                if (i % j == 0) {
                    isPrime = false;
                }
            }
            if (isPrime) {
                System.out.println(i);
            }
            isPrime = true;
        }
        long totalTime = System.currentTimeMillis() - start;
        System.out.println("totalTime: " + totalTime + "ms");
    }
}
